package C_AdapterMode;

/**
 * Created by zc on 2017/3/12.
 * 对象适配器    组合方式实现适配器
 * 二相电转三相电的插座适配器
 *      实现了目标接口
 */
public class TwoPlugAdapter implements ThreePlugIf {
    private GBTwoPlug twoPlug;

    public TwoPlugAdapter(GBTwoPlug twoPlug) {
        this.twoPlug = twoPlug;
    }

    @Override
    public void powerWithThreePlug() {
        System.out.println("通过转换器 供电 2 -> 3");
        twoPlug.powerWithTwoPlug();
    }
}
